#include<iostream>
#include<string.h>
#include<vector>

using std::cout;
using std::cin;
using std::endl;
using std::string;
using std::vector;

int main()
{
    string p("hello");
    string p1(p);
    string p2(p,1,2);
    string p3('x',10);
    string p4(p.begin(),p.end());
    cout<<p1+" "+p1<<endl
        <<p2+"+"+p3<<endl
        <<p4<<endl;
    //c风格字符串转换
printf("%s\n",p.c_str());
printf("%s\n",p.data());

printf("%d\n",p.empty());

printf("%lu\n",p.size());
printf("%lu\n",p.length());

cout<<p.append(5,'x')<<endl;
cout<<p.append(p1)<<endl;
cout<<p.append(p3,9,1)<<endl;
cout<<p.append("123")<<endl;
//查找子串
cout<<p.find(p2)<<endl;
cout<<p.find('x',1)<<endl;
cout<<p.find("hello",1,10)<<endl;

string p5("hello world");
for(auto &i:p5)
{
    cout<<i<<" " ;
}
cout<<endl;
//string::itreator 
auto it = p.begin();
while(it!=p.end())
{
    cout<<*it<<" ";
    ++it;
}
cout<<endl;

vector <int> arr;

//vecor <int> arr(10);
//vector <int> arr(10,5) 10个5
//vector <int> arr{1,2,2,3};
//vector <int>arr1(arr.begin(),arr.end()-2);
//
int i=0;
while(i=1,i<100)
{
    i++;
}

}
